/*
 *  Copyright (C) 2010 MADSA.
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see http://www.gnu.org/licenses/. 
 *
 *  Author: Victor Mayoral Vilches
 *          Jorge Pintado de Santiago
 */


package com.madsa.tuPeli;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;

public class Cine {
	private String name;
	private String address;
	private String municipio;
	private String phone;
	private String price;	
	private HashMap<String, ArrayList<Pelicula>> movies;
	
	public Cine(){		
		this.movies = new HashMap<String, ArrayList<Pelicula>>();
	}

	public Cine(String name, String price){
		this.name = name;
		this.price = price;
		
	}
		
	public String toString(){
		String salida = "Nombre del cine: " + this.getName() + "\n";
		salida += "Direccion: " + this.address + "\n" + "Municipio: " 
				  + this.municipio + "\n" + "Teléfono: " + this.phone 
				  + "\n" + "Precios: " + this.price+"\n\n" + "Peliculas:\n";

		for(String fecha : this.movies.keySet()){
			salida += "***************************************************************************\n";
			salida += "***************************************************************************\n";
			salida += fecha.toString() + "\n";
			for(Pelicula pel: this.movies.get(fecha)){
				salida += "  " + pel.toString() + "\n";
			}
		}		
	 	return salida;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getAddress() {
		return address;
	}

	public void setMunicipio(String municipio) {
		this.municipio = municipio;
	}

	public String getMunicipio() {
		return municipio;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getPhone() {
		return phone;
	}

	public void setPrice(String price) {
		this.price = price;
	}

	public String getPrice() {
		return price;
	}

	public void setPelis(String fecha, ArrayList<Pelicula> movies) {
		if(fecha != null && movies != null){
			this.movies.put(fecha, movies);
		}
	}

	public ArrayList<Pelicula> getPelis(Date fecha) {
		return movies.get(fecha);
	}
}